home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / General / SpriteWorld 1.0b3 / Examples / SpriteTest / Application.h < prev    next >
Text File  |  1993-06-12  |  3KB  |  115 lines

  1. ///--------------------------------------------------------------------------------------
  2. //    Application.h
  3. //
  4. //    Created:    Sunday, April 11, 1993
  5. //    By:        Tony Myles
  6. //
  7. //    Copyright: © 1993 Tony Myles, All rights reserved worldwide.
  8. ///--------------------------------------------------------------------------------------
  9.  
  10.  
  11. #ifndef __APPLICATION__
  12. #define __APPLICATION__
  13.  
  14. #ifndef __APPLEEVENTS__
  15. #include <AppleEvents.h>
  16. #endif
  17.  
  18.  
  19. enum
  20. {
  21.     kStackNeeded = 32000,
  22.     kNumberOfMoreMastersCalls = 3
  23. };
  24.  
  25. enum
  26. {
  27.     kMenuBarResID = 128,
  28.     kWindowResID = 128
  29. };
  30.  
  31. enum
  32. {
  33.     kAppleMenuID = 128,
  34.     kFileMenuID = 129,
  35.     kEditMenuID = 130,
  36.     kSpriteMenuID = 131
  37. };
  38.  
  39. enum
  40. {
  41.     kAboutItem = 1,
  42.     kQuitItem = 1,
  43.     kHideTitleItem = 1,
  44.     kHideBallsItem,
  45.     kCollisionDetectionItem,
  46.     kCopyBitsTestItem,
  47.     kBlitPixieTestItem,
  48.     kSpriteTestItem
  49. };
  50.  
  51. enum
  52. {
  53.     kForeGroundSleepTime = 0,
  54.     kBackGroundSleepTime = 0
  55. };
  56.  
  57. enum
  58. {
  59.     kErrorAlertResID = 128,
  60.     kCantRunAlertResID = 129,
  61.     kErrorStringListResID = 128,
  62.     kUnknownErrorStringIndex = 1,
  63.     kCantFindResourceStringIndex = 2,
  64.     kNotEnoughMemoryStringIndex = 3
  65. };
  66.  
  67. #define kSeriousDamageString "\pCould not even get error string!\rThis application is seriously damaged!"
  68.  
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73.  
  74. void main(void);
  75. Boolean Initialize(short numberOfMasters);
  76. Boolean CheckSystem(void);
  77. Boolean CheckMemory(void);
  78. Boolean HasAppleEvents(void);
  79. Boolean HasWaitNextEvent(void);
  80. OSErr InstallAppleEventHandlers(void);
  81. void CreateMenuBar(void);
  82. void CreateWindow(void);
  83. Boolean EnterApplication(void);
  84. void ExitApplication(void);
  85. void ServiceEvents(void);
  86. void DispatchEvent(EventRecord* event);
  87. void HandleMouseEvent(EventRecord* event);
  88. void HandleKeyEvent(char key, short modifiers);
  89. void HandleUpdateEvent(WindowPtr updateWindowP);
  90. void HandleActivateEvent(WindowPtr updateWindowP);
  91. void HandleOSEvent(long message);
  92. void HandleDiskEvent(long message);
  93. void HandleNullEvent(void);
  94. void HandleMenuCommand(long menuItemIdentifier);
  95. void HandleAppleMenuCommand(short menuItem);
  96. void HandleFileMenuCommand(short menuItem);
  97. void HandleEditMenuCommand(short menuItem);
  98. void HandleSpriteMenuCommand(short menuItem);
  99. pascal OSErr HandleOpenApp(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  100. pascal OSErr HandleOpenDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  101. pascal OSErr HandlePrintDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  102. pascal OSErr HandleQuit(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
  103. void ErrorAlert(OSErr err, short errorStringIndex);
  104. void CantFindResource(void);
  105. void CantRunOnThisMachine(void);
  106. short NumToolboxTraps(void);
  107. TrapType GetTrapType(short trap);
  108. Boolean TrapAvail(short trap);
  109.  
  110. #ifdef __cplusplus
  111. };
  112. #endif
  113.  
  114.  
  115. #endif /* __APPLICATION__ */